package com.simon.api.zsortset;

import redis.clients.jedis.Jedis;

import java.util.Random;

/**
 * Created by changf on 2017/7/7.
 */
public class WangZheChoose {
    public static void main(String[] args) throws Exception{
        Jedis jedis=new Jedis("192.168.112.12",6379);
        String[] heros={"亚瑟","马可波罗","鲁班七号","程咬金","诸葛亮","小乔","曹操","荆轲"};
        while(true){
            String chooseHero= heros[new Random().nextInt(heros.length)];
            jedis.zincrby("hero:pipei",1,chooseHero);
            System.out.println("hero:"+chooseHero+"出场...");
            Thread.sleep(1000);

        }






    }
}
